home *** CD-ROM | disk | FTP | other *** search
/ Champak 54 / Vol 54.iso / games / williame.swf / scripts / frame_22 / PlaceObject2_271_46 / CLIPACTIONRECORD onClipEvent(enterFrame).as < prev   
Encoding:
Text File  |  2007-09-27  |  868 b   |  46 lines

  1. onClipEvent(enterFrame){
  2.    xheros = _root.ship._x;
  3.    yheros = _root.ship._y;
  4.    x = _root.popo._x;
  5.    y = _root.popo._y;
  6.    if(x < xheros)
  7.    {
  8.       setProperty("_root.popo", _X, x + 7);
  9.    }
  10.    if(xheros < x)
  11.    {
  12.       setProperty("_root.popo", _X, x - 7);
  13.    }
  14.    if(y < yheros)
  15.    {
  16.       setProperty("_root.popo", _Y, y + 7);
  17.    }
  18.    if(yheros < y)
  19.    {
  20.       setProperty("_root.popo", _Y, y - 7);
  21.    }
  22.    if(x < xheros - 4 and y != yheros)
  23.    {
  24.       setProperty("_root.popo", _rotation, 0);
  25.    }
  26.    if(xheros + 4 < x and y != yheros)
  27.    {
  28.       setProperty("_root.popo", _rotation, 180);
  29.    }
  30.    if(this.hitTest(_root.ship))
  31.    {
  32.       tellTarget("_root.energie")
  33.       {
  34.          nextFrame();
  35.       }
  36.       tellTarget("_root.popo")
  37.       {
  38.          gotoAndStop(2);
  39.       }
  40.    }
  41.    else
  42.    {
  43.       play();
  44.    }
  45. }
  46.